package com.mj.dao;

import com.mj.entity.Book;
import com.mj.mapper.BookMapper;
import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Data
@Service("ab")
public class BookDao implements BookMapper {
    @Autowired
    private BookMapper bdao;

    public Book queryById(int id) {
        return bdao.queryById(id);
    }

    public List<Book> queryAll() {
        return bdao.queryAll();
    }

    public int insert(Book book) {
        return bdao.insert(book);
    }

    public int add(String name, double price, Date date) {
        return bdao.add(name, price, date);
    }

    public int deleteById(int id) {
        return bdao.deleteById(id);
    }
}
